package com.morgan.recyclerviewdemo.utils

import com.morgan.recyclerviewdemo.entity.IClassificateTag
import java.util.*
import kotlin.Comparator

/**
 *description：
 *<br>author：caowugao
 *<br>time：2020/7/12 0012 18:21
 */
class SortUtils private constructor(){


    companion object {
        val COMPARATOR = object : Comparator<IClassificateTag> {
            override fun compare(o1: IClassificateTag?, o2: IClassificateTag?): Int {
                return o1!!.getTag().compareTo(o2!!.getTag())
            }
        }

        fun sort(list : List<IClassificateTag>) {
            Collections.sort(list, COMPARATOR)
        }
    }
}